<template>
  <div>
    <input type="text" v-model="score" />
    <!-- 条件渲染 -->
    <p v-if="scoreInt >= 100">优秀</p>
    <p v-else-if="scoreInt >= 60">及格</p>
    <p v-else>不及格</p>
  </div>
</template>

<script>
export default {
  data: () => ({
    score: ''
  }),
  computed: {
    scoreInt() {
      let scoreInt = parseInt(this.score)
      if (Number.isNaN(scoreInt)) scoreInt = 0
      return scoreInt
    }
  }
}
</script>
